<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="../resources/admin/css/header.css">
<link rel="stylesheet" type="text/css"
	href="../resources/admin/css/criclemenu.css">
<link rel="stylesheet" type="text/css"
	href="../resources/admin/css/add-category.css">
<link rel="stylesheet" type="text/css"
	href="../resources/admin/css/category.css">
</head>
<body>
	<div style="margin-top: 50px; color: blue;">Danh Sách Chi Tiết
		Sản Phẩm: ${product.productName}</div>
	<div>
		<a href="addProductDetail.html?productId=${product.productId}"
			class="button">Thêm</a>
	</div>



	<div class="CSSTableGenerator">
		<table>
			<tr>
				<td>Mã Sản Phẩm</td>
				<td>Size</td>
				<td>Giá Cũ</td>
				<td>Giá Mới</td>
				<td>Tác Vụ</td>
			</tr>
			<c:forEach var="product" items="${productDetails}">
				<tr>
					<td>${product.productDetailId}</td>
					<td><c:forEach var="type" items="${types}">
							<c:set var="flag" value="${0}"></c:set>
							<c:forEach var="detail" items="${product.typeDetails}">
								<c:if test="${detail.type.typeId == type.typeId}">
									<c:set var="flag" value="${1}"></c:set>
								</c:if>
							</c:forEach>
							<c:if test="${flag == 1}">
								<p>
									<c:forEach var="detail" items="${product.typeDetails}">
										<c:if test="${detail.type.typeId == type.typeId}">
											<p>${detail.typeDetailName}</p>
										</c:if>
									</c:forEach>


								</p>
							</c:if>

						</c:forEach></td>
					<td>${product.price }</td>
					<td>${product.oldPrice }</td>
					<td>
						<div>
							<p></p>
							<a
								href="productDetail.html?productDetailId=${product.productDetailId}"
								class="button"> Sửa </a>
						</div>
						<p></p>
						<div>
							<a href="" class="button">Xóa</a>
						</div>
					</td>
				</tr>
			</c:forEach>

		</table>
	</div>
</body>
